<!DOCTYPE html>
<html>
<head>
   <link href="build/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet" />
   <script type="text/javascript" src="build/ext-all.js"></script>
   <script type="text/javascript">
      var obj={name:'john'};
       Ext.onReady(function () {
         var btn=Ext.create({xtype:'button'
          ,html:'add'
          ,renderTo:'helloWorldPanel'
          ,listeners:{
            scope:obj,
            click:function(){
              alert(this.name);
            }
          }
        });
        btn.on("click",function(){
          alert(obj.name+"....");
        });
      });
   </script>
</head>
<body>
   <div id="helloWorldPanel"></div>
</body>
</html>